home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Conditional_VBScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.5 KB  |  61 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3.  
  4. <!*************************
  5. This sample is provided for educational purposes only. It is not intended to be 
  6. used in a production environment, has not been tested in a production environment, 
  7. and Microsoft will not provide technical support for it. 
  8. *************************>
  9.  
  10. <HTML>
  11.     <HEAD>
  12.         <TITLE>Conditional Operator Sample</TITLE>
  13.     </HEAD>
  14.  
  15.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  16.  
  17.  
  18.         <!-- Display header. -->
  19.  
  20.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  21.         <B>Conditional Operator Sample</B></FONT><BR>
  22.       
  23.         <HR SIZE="1" COLOR="#000000">
  24.         <!-- If...Then example -->
  25.         
  26.         <% 
  27.             Dim varDate
  28.             varDate = Date()
  29.         %>
  30.         
  31.         <P>The date is: <%= varDate %></P>
  32.  
  33.         <%
  34.            'Select Case statement to display a message based on the day of the month.
  35.            Select Case Day(varDate)
  36.               Case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  37.                 Response.Write("<P>It's the beginning of the month.</P>")
  38.  
  39.               Case 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
  40.                 Response.Write("<P>It's the middle of the month.</P>")
  41.  
  42.               Case Else
  43.                 Response.Write("<P>It's the end of the month.</P>")
  44.            End Select
  45.         %>
  46.  
  47.         <P>The time is: <%= Time %></P>
  48.  
  49.         <%
  50.            'Check for AM/PM, and output appropriate message.
  51.         
  52.            If (Right(Time,2)="AM") Then            
  53.                 Response.Write("<P>Good Morning</P>")                
  54.            Else            
  55.                 Response.Write("<P>Good Evening</P>")                
  56.            End If
  57.         %>
  58.  
  59.     </BODY>
  60. </HTML>
  61.